package com.wd.myhome.viewmodel

import android.util.Log
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.wd.current.model.Bean.DataBean
import com.wd.current.model.Utils.HttpUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * 作者: 张智聪
 * 时间: 2024/10/23
Time:  11:02
 * 描述:
 */
class LiveRoomViewModel :ViewModel(){
    //看直播
    var watchLiveData= MutableLiveData<DataBean.WatchLiveBean2>()
fun getWatchLiveData(userId:Int, sessionId:String, liveId:Int){
 HttpUtils.httpUtils.aplis
     .getWatchLiveData(userId, sessionId, liveId)
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())

        .subscribe {
            watchLiveData.value=it
          Log.i("zhib",it.result.toString())
        }
}

    //查询所有礼物列表
    var findAllGiftData=MutableLiveData<DataBean.FindAllGiftBean>()
    fun getFindAllGiftData(){
       HttpUtils.httpUtils.aplis2.getAllGiftData()
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe {
                findAllGiftData.value=it
            }



    }
}